home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / answrbok / 5_9.lha / 5_9 / 5_9b1.c < prev    next >
C/C++ Source or Header  |  1993-08-08  |  413b  |  19 lines

  1. * Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */
  2. * The C++ Answer Book */
  3. * Tony Hansen */
  4. * All rights reserved. */
  5. / char_stack class as defined in section 5.2.5
  6. lass char_stack
  7.  
  8.    int size;
  9.    char *top;
  10.    char *s;
  11.  
  12. ublic:
  13.    char_stack(int sz) { top = s = new char[size=sz]; }
  14.    ~char_stack() { delete s; }
  15.  
  16.    void push(char c) { *top++ = c; }
  17.    char pop() { return *--top; }
  18. ;
  19.